<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>声明（创建）数字</title>
</head>

<body>
    <h2>JavaScript 数值</h2>
    <p>写数值时用不用小数点均可：</p>
    <p id="demo"></p>
    <script>
        var x1 = 34.00;
        var x2 = 34;
        var x3 = 3.14;
        document.getElementById("demo").innerHTML = x1 + "<br>" + x2 + "<br>" + x3;
    </script>
</body>

</html>